﻿@using QDT.Common
@using QDT.Web.Admin.Models
@model QDT.Common.IPagedList<QDT.Web.Admin.Models.ArticleModel>
<div class="main_title">文章列表</div>
<div class="blank5"></div>
<div class="button_row">
    @Html.ActionLink("新增", "Add", "Article",null, new {@class = "button"})
    <a href="javascript:;" onclick="del();" class="button">删除</a>
</div>
<div class="blank5"></div>
@using (Html.BeginForm("Index", "Article", FormMethod.Post)) {
    <div class="search_row">
        分类：<select name="cateId">
               <option value="0">==所有分类==</option>
               @if (ViewData["CateModel"] != null) {
                   foreach (ArticleCateTree m in ViewData["CateModel"] as IList<ArticleCateTree>) {
                       if (Request.Params["cateId"] != "" && Convert.ToInt16(Request.Params["cateId"]) == m.Id) {
                           <option value="@m.Id" selected="selected">@(new MvcHtmlString(m.Title))</option>
                                continue;
                       }
                       <option value="@m.Id">@(new MvcHtmlString(m.Title))</option>
                   }
               }
            
           </select>
        编号：<input type="text" class="textbox" name="id" value="@Request.Params["id"]">		
        名称：<input type="text" class="textbox" name="title" value="@Request.Params["title"]">		
           <input type="submit" class="button" value="搜索">
    </div>
    <div class="blank5"></div>
    <div class="grid_box">
        <div class="grid_top"></div>

        <!-- Think 系统列表组件开始 -->
        @Html.Grid(Model).Columns(column =>
   {
       column.CheckBox(o => o.Id);
       column.For(x => x.Id).Named("编号").SortColumnName("ID");
       column.For(x => Html.ActionLink(x.Title,"Edit",new {id=x.Id})).Named("文章标题").SortColumnName("Title");
       column.For(x => x.CateName).Named("分类").SortColumnName("CateId");
       column.For(x => x.IsEffect ? "有效" : "失效").Named("状态").SortColumnName("IsEffect");
       column.For(x => x.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")).Named("创建时间").SortColumnName("CreateTime");
       column.For(x => x.UpdateTime.ToString("yyyy-MM-dd HH:mm:ss")).Named("更新时间").SortColumnName("UpdateTime");
       column.For(x => x.Sort).Named("排序").SortColumnName("Sort");
       column.For(x => x.ClickCount).Named("点击数").SortColumnName("ClickCount");
       column.Buttons(btns => btns.Add(x => Html.ActionLink("编辑","Edit",new{id=x.Id}))
                                  .Add(o => Html.ScriptLink("删除", "del({0})".FormatWith(o.Id))));
   }).Complex(ViewData)
        <!-- Think 系统列表组件结束 -->
 

        <div class="blank5"></div>
        @Html.Pager(Model)
    </div>
}